import request from '@/utils/request'

//对应后端查询菜单列表接口
export const CategoryBrandList = (pageNum,pageSize,data)=>{
    return request({
        url:`/admin/product/categoryBrand/${pageNum}/${pageSize}`,
        method:'post',
        data
    })
}


//对应后端添加接口
export const AddCategoryBrand = (data)=>{
    return request({
        url:`/admin/product/categoryBrand/addCategoryBrand`,
        method:'post',
        data
    })
}

// 返回三个分类id
export const GetIdsByCategory3Id = (category3Id)=>{
    return request({
        url:`/admin/product/categoryBrand/getIdsByCategory3Id/${category3Id}`,
        method:'get'
    })
}

//修改
export const UpdateCategoryBrandById = categoryBrand => {
    return request({
        url: `/admin/product/categoryBrand/updateById`,
        method: 'put',
        data: categoryBrand,
    })
}

// 根据id删除数据
export const DeleteCategoryBrandById = id => {
    return request({
      url: `/admin/product/categoryBrand/deleteById/${id}`,
      method: 'delete',
    })
}

export const FindBrandByCategoryId = (category3Id)=>{
    return request({
        url:`/admin/product/brand/findByCategory3Id/${category3Id}`,
        method:'get'
    })
}